package com.xhd.server;

public class XServerId {
	private String jm111 = null;
	  private String jm392 = null;
	  private String jm84 = null;
	  private int jm531 = 0;
	  private static XServerId jm639 = null;

	  private XServerId()
	  {
	  }

	  public XServerId(String paramString)
	  {
	    if ((paramString == null) || (paramString.length() <= 0))
	      return;
	    this.jm111 = paramString;
	    int i = 0;
	    int j = 0;
	    for (int k = 0; (j == 0) && (k < 3); ++k)
	    {
	      int l = this.jm111.indexOf(46, i);
	      String str = null;
	      if (l > 0)
	      {
	        str = this.jm111.substring(i, l);
	        i = l + 1;
	      }
	      else
	      {
	        str = this.jm111.substring(i);
	        j = 1;
	      }
	      if (k == 0)
	      {
	        this.jm392 = str;
	      }
	      else if (k == 1)
	      {
	        if ((str == null) || (str.length() <= 0))
	          continue;
	        this.jm531 = Integer.parseInt(str);
	      }
	      else
	      {
	        this.jm84 = str;
	      }
	    }
	  }

	  public XServerId(String paramString, int paramInt)
	  {
	    jm638(paramString, paramInt, null);
	  }

	  public XServerId(String paramString1, int paramInt, String paramString2)
	  {
	    jm638(paramString1, paramInt, paramString2);
	  }

	  public static XServerId getAllLocal()
	  {
		  XServerId localXServerId = new XServerId();
	    localXServerId.jm638(ServerConfig.CompanyId, 0, null);
	    return localXServerId;
	  }

	  public static XServerId getLocal()
	  {
	    if (jm639 != null)
	      return jm639;
	    XServerId localXServerId = new XServerId();
	    localXServerId.jm638(ServerConfig.CompanyId, ServerConfig.ServerType, ServerConfig.ServerId);
	    jm639 = localXServerId;
	    return localXServerId;
	  }

	  public static XServerId getLocal(int paramInt, String paramString)
	  {
	    XServerId localXServerId = new XServerId();
	    localXServerId.jm638(ServerConfig.CompanyId, paramInt, paramString);
	    return localXServerId;
	  }

	  public static XServerId getLocal(int paramInt)
	  {
	    XServerId localXServerId = new XServerId();
	    localXServerId.jm638(ServerConfig.CompanyId, paramInt, null);
	    return localXServerId;
	  }

	  public String getCompId()
	  {
	    return this.jm392;
	  }

	  public int getServerType()
	  {
	    return this.jm531;
	  }

	  public String getServerId()
	  {
	    return this.jm84;
	  }

	  public String getId()
	  {
	    return this.jm111;
	  }

	  private String jm638(String paramString1, int paramInt, String paramString2)
	  {
	    this.jm531 = paramInt;
	    this.jm84 = paramString2;
	    this.jm392 = paramString1;
	    if (this.jm531 < 1)
	    {
	      this.jm111 = this.jm392;
	      return this.jm111;
	    }
	    if ((this.jm84 == null) || (this.jm84.length() < 1))
	      this.jm111 = this.jm392 + "." + this.jm531;
	    else
	      this.jm111 = this.jm392 + "." + this.jm531 + "." + this.jm84;
	    return this.jm111;
	  }
}
